package com.zy.explore.design.interfaces.facade.v1;

import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
import com.zy.explore.design.patterns.factory.FactoryUseService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

/**
 * description 工厂模式示例Facade
 *
 * @author 🇨🇳中国印🇨🇳
 * @date 2021年05月15日 14:27
 */
@Api(tags = {"工厂模式示例Facade"})
@RestController
@RequestMapping("/factory")
public class FactoryFacade {

    @Resource
    private FactoryUseService factoryUseService;

    @ApiOperationSupport(order = 10, author = "🇨🇳中国印🇨🇳")
    @ApiOperation("工厂模式")
    @PostMapping("/useFactory")
    public Integer useFactory(@RequestParam String fileType) {
        factoryUseService.resolveFile(fileType);
        return 1;
    }
}
